<%--
  Created by IntelliJ IDEA.
  User: lzy
  Date: 2024/10/31
  Time: 23:24
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="/static/layui/css/layui.css">
    <style>
    </style>

</head>
<body>
<p>
<form action="/student/list/1" method="post">
    <!--20行name需要改和数据库表中值相同-->
    <div class="layui-form-item">
        <div class="layui-inline">
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" name="studentNum" value="${condition.studentNum}" placeholder="请输入学号"  class="layui-input">
            </div>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" name="studentName" value="${condition.studentName}" placeholder="请输入学生姓名" class="layui-input">
            </div>
            <button type="submit" class="layui-btn" lay-submit lay-filter="demo1">查询</button>
            <a class="layui-btn  layui-bg-blue" href="/student/toadd">新增用户</a>
        </div>
    </div>
</form>
</p>
<table class="layui-table" lay-even>
    <colgroup>
        <col width="150">
        <col width="150">
        <col>
        <col>
    </colgroup>
    <thead>
    <tr>
        <th>编码</th>
        <th>学号</th>
        <th>姓名</th>
        <th>性别</th>
        <th>年龄</th>
        <th>出生日期</th>
        <th>班级编号</th>
        <th>宿舍编号</th>
        <th>联系电话</th>
        <th>邮箱地址</th>
        <th>家庭住址</th>
        <th>紧急联系人姓名</th>
        <th>紧急联系人电话</th>
        <th>专业</th>
        <th>学生状态</th>
        <th>删除标志</th>
        <th>创建者</th>
        <th>创建时间</th>
        <th>更新者</th>
        <th>更新时间</th>
        <th>备注</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${students}" var="s">
        <tr>
            <td>${s.sId}</td>
            <td>${s.studentNum}</td>
            <td>${s.studentName}</td>
            <td>
                <c:choose>
                    <c:when test="${s.gender=='0'}">男</c:when>
                    <c:otherwise>女</c:otherwise>
                </c:choose>
            </td>
            <td>${s.age}</td>
            <td><fmt:formatDate value="${s.birthday}"></fmt:formatDate></td>
            <td>${s.classId}</td>
            <td>${s.hostelId}</td>
            <td>${s.studentPhone}</td>
            <td>${s.studentEmail}</td>
            <td>${s.homeAddress}</td>
            <td>${s.emergencyContact}</td>
            <td>${s.emergencyPhone}</td>
            <td>${s.major}</td>
            <td>
                <c:choose>
                    <c:when test="${s.status=='0'}">在读</c:when>
                    <c:otherwise>毕业</c:otherwise>
                </c:choose>
            </td>
            <td>
                <c:choose>
                    <c:when test="${s.delFlag=='0'}">未删除</c:when>
                    <c:otherwise>已删除</c:otherwise>
                </c:choose>
            </td>
            <td>${s.createBy}</td>
            <td><fmt:formatDate value="${s.createDate}"></fmt:formatDate></td>
            <td>${s.updateBy}</td>
            <td><fmt:formatDate value="${s.updateDate}"></fmt:formatDate></td>
            <td>${s.remark}</td>
            <td>
                <a href="/student/toupdate/${s.sId}">修改</a>
                <a href="/student/delete/${s.sId}">删除</a>
            </td>
        </tr>
    </c:forEach>
    <tr>
        <%--colspan代表合并的列数--%>
        <td colspan="4" style="text-align: center">
            <a href="/student/list/1">首页</a>
            <c:if test="${page.currentPage!=1}">
                <a href="/user/list/${page.currentPage-1}">上一页</a>
            </c:if>
            第${page.currentPage}页/共${page.totalPage}页
            <c:if test="${page.currentPage!=page.totalPage}">
                <a href="/user/list/${page.currentPage+1}">下一页</a>
            </c:if>
            <a href="/user/list/${page.totalPage}">尾页</a>
        </td>
    </tbody>
</table>

</body>
</html>
